#!/bin/bash

if [ $# != 1 ];then
        echo "Usage tps.sh <time(s)>"
        exit 1
fi

total=0
for filename in `ls nohup.*`;do
      transactions=` tail -1 $filename | sed 's/.*\[//g' | sed 's/\].*//g'`
      total=`expr $total + $transactions`
      echo $filename $transactions
done
echo "total: " `expr $total / $1`